package com.sino.tb.auditing.entity;

import java.sql.*;
import java.util.*;

public class ConfirmPortalFlow {

	private String portal;
	private String key;
	private String department;
	private String passPower;
	private String noPassPower;
	private String returnUP;
	private String returnDOWN;
	private String forwardFlag;
	private String forwardList;
	public static Hashtable findByType(String type, String dept,
									   Connection conn) {
		Hashtable result = new Hashtable();
		StringBuffer sql = new StringBuffer("SELECT t2.* ");
		sql.append("FROM t_st_declare_portal t1, t_st_declare_flow t2 ");
		sql.append("WHERE  t1.c_seq = t2.c_portal_seq ");
		sql.append(" AND t1.c_type_seq =  " + type);
		sql.append(" AND t1.c_dept_id = " + dept + "  ORDER BY  t2.c_seq ");

		try {
			Statement stmt = conn.createStatement();
			ResultSet rs = stmt.executeQuery(sql.toString());

			while (rs.next()) {
				ConfirmPortalFlow value = new ConfirmPortalFlow();
				value.setPortal(rs.getString("c_portal_seq"));
				value.setKey(rs.getString("c_seq"));
				value.setDepartment(rs.getString("c_dept_seq"));
				value.setPassPower(rs.getString("c_pass"));
				value.setNoPassPower(rs.getString("c_nopass"));
				value.setReturnUP(rs.getString("c_return_up"));
				value.setReturnDOWN(rs.getString("c_return_down"));
				value.setForwardFlag(rs.getString("c_forward_flag"));
				value.setForwardList(rs.getString("c_forward_list"));
				result.put(value.getKey(), value);
			}
			rs.close();
			stmt.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

	public String getPortal() {
		return portal;
	}

	public void setPortal(String portal) {
		this.portal = portal;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getPassPower() {
		return passPower;
	}

	public void setPassPower(String passPower) {
		this.passPower = passPower;
	}

	public String getNoPassPower() {
		return noPassPower;
	}

	public void setNoPassPower(String noPassPower) {
		this.noPassPower = noPassPower;
	}

	public String getReturnUP() {
		return returnUP;
	}

	public void setReturnUP(String returnUP) {
		this.returnUP = returnUP;
	}

	public String getReturnDOWN() {
		return returnDOWN;
	}

	public void setReturnDOWN(String returnDOWN) {
		this.returnDOWN = returnDOWN;
	}

	public String getForwardFlag() {
		return forwardFlag;
	}

	public void setForwardFlag(String forwardFlag) {
		this.forwardFlag = forwardFlag;
	}

	public String getForwardList() {
		return forwardList;
	}

	public void setForwardList(String forwardList) {
		this.forwardList = forwardList;
	}

}
